package com.snda.game.legend.trigger;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Scope;

import com.snda.game.legend.service.AdService;
import com.snda.game.legend.service.LegendService;

@Configurable("expiredTrigger")
@Scope
@DependsOn
public class ExpiredTrigger implements Job {
    /**
     * Logger for this class
     */
    private static final Logger logger = Logger.getLogger(ExpiredTrigger.class);

	private LegendService legendService;
    private AdService adService;

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
        logger.info("expiredTrigger excute");
        legendService.expired();
        adService.expired();
	}

	public LegendService getLegendService() {
		return legendService;
	}

	public void setLegendService(LegendService legendService) {
		this.legendService = legendService;
	}

    public AdService getAdService() {
        return adService;
    }

    public void setAdService(AdService adService) {
        this.adService = adService;
    }

}
